package com.aurora.demo.repository;

import com.aurora.demo.entity.Meta;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MetaRepository extends MongoRepository<Meta, String> {

    @Query("{ 'time' : { $gt: ?0, $lt: ?1 } }")
    List<Meta> findByTimeBetween(String startTime, String startTime1);

    @Query("{ 'name' : ?0 }" )
    Meta findByName(String name);
}
